package com.zzq.my.jetpacks.jectpackapp.adapter


import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.drakeet.multitype.ItemViewBinder
import com.zzq.my.jetpacks.jectpackapp.R


/**
 * 描述：class describe
 * 作者：zhuangzeqin
 * 时间: 2021/12/7-13:42
 * 邮箱：zzq@eeepay.cn
 * 备注:
 */
class FlexBoxAdapter:ItemViewBinder<String,FlexBoxAdapter.TitleHolder>(){

    override fun onBindViewHolder(holder: TitleHolder, item: String) {
        holder.textView.text = item
    }

    override fun onCreateViewHolder(inflater: LayoutInflater, parent: ViewGroup): TitleHolder {
        val view: View = inflater.inflate(R.layout.item_flex,parent, false)
        return TitleHolder(view)
    }

    class TitleHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
        var textView: TextView
        init {
            textView = itemView.findViewById<View>(R.id.item_tv_msg) as TextView
        }
    }
}